<?php
/**
 * Created by laoyu.
 * User: hilaoyu@qq.com
 * Date: 2018/5/8
 * Time: 17:48
 */

namespace Hilaoyu\LaravelExtend\Services\Auth\Redefinition;


use Hilaoyu\Utils\UtilStr;

class TokenGuard extends \Illuminate\Auth\TokenGuard
{

    public function getTokenForRequest()
    {
        $token =  $this->request->header(UtilStr::underlineToHump($this->inputKey)
            ,$this->request->header(UtilStr::lower(UtilStr::underlineToHump($this->inputKey))
                ,$this->request->header('SessionToken'
                    ,$this->request->header('sessiontoken'
                        ,parent::getTokenForRequest()
                    )
                )
            )
        );

        return $token;
    }


}
